<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
    <title>colorizer Docs</title>
    <link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

<div id="container">

<div id="product">
	<div id="product_logo"></div>
	<div id="product_name"><big><b></b></big></div>
	<div id="product_description"></div>
</div> <!-- id="product" -->


<div id="main">


<!-- Menu -->

<div id="navigation">
<br/>
<h1>colorizer</h1>


<ul>
  <li><a href="../index.html">Index</a></li>
</ul>

<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
<li><a href="#Tables">Tables</a></li>
</ul>


<h2>Modules</h2>
<ul class="nowrap">
  <li><a href="../modules/colorizer.html">colorizer</a></li>
  <li><a href="../modules/colorizer.buffer.html">buffer</a></li>
  <li><a href="../modules/colorizer.color.html">color</a></li>
  <li><strong>config</strong></li>
  <li><a href="../modules/colorizer.constants.html">constants</a></li>
  <li><a href="../modules/colorizer.matcher.html">matcher</a></li>
  <li><a href="../modules/colorizer.parser.rgb_hex.html">parser.rgb_hex</a></li>
  <li><a href="../modules/colorizer.parser.hsl.html">parser.hsl</a></li>
  <li><a href="../modules/colorizer.parser.names.html">parser.names</a></li>
  <li><a href="../modules/colorizer.parser.oklch.html">parser.oklch</a></li>
  <li><a href="../modules/colorizer.parser.rgb.html">parser.rgb</a></li>
  <li><a href="../modules/colorizer.parser.rgba_hex.html">parser.rgba_hex</a></li>
  <li><a href="../modules/colorizer.parser.xterm.html">parser.xterm</a></li>
  <li><a href="../modules/colorizer.sass.html">sass</a></li>
  <li><a href="../modules/colorizer.tailwind.html">tailwind</a></li>
  <li><a href="../modules/trie.html">trie</a></li>
  <li><a href="../modules/colorizer.usercmds.html">usercmds</a></li>
  <li><a href="../modules/colorizer.utils.html">utils</a></li>
</ul>

</div>

<div id="content">

<h1>Module <code>colorizer.config</code></h1>
<p>Provides configuration options and utilities for setting up colorizer.</p>
<p></p>


<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
	<tr>
	<td class="name" nowrap><a href="#set_bo_value">set_bo_value (bo_type, val, ud_opts)</a></td>
	<td class="summary">Set options for a specific buffer or file type.</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#apply_alias_options">apply_alias_options (ud_opts)</a></td>
	<td class="summary">Parse and apply alias options to the user options.</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#get_setup_options">get_setup_options (opts)</a></td>
	<td class="summary">Initializes colorizer with user-provided options.</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#new_bo_options">new_bo_options (bufnr, bo_type)</a></td>
	<td class="summary">Retrieve buffer-specific options or user_default_options defined when setup() was called.</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#get_bo_options">get_bo_options (bo_type, buftype, filetype)</a></td>
	<td class="summary">Retrieve options based on buffer type and file type.</td>
	</tr>
</table>
<h2><a href="#Tables">Tables</a></h2>
<table class="function_list">
	<tr>
	<td class="name" nowrap><a href="#user_default_options">user_default_options</a></td>
	<td class="summary">Default user options for colorizer.</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#options">options</a></td>
	<td class="summary">Options for colorizer that were passed in to setup function</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#ud_opts">ud_opts</a></td>
	<td class="summary">Configuration options for the `setup` function.</td>
	</tr>
</table>

<br/>
<br/>


    <h2 class="section-header "><a name="Functions"></a>Functions</h2>

    <dl class="function">
    <dt>
    <a name = "set_bo_value"></a>
    <strong>set_bo_value (bo_type, val, ud_opts)</strong>
    </dt>
    <dd>
    Set options for a specific buffer or file type.


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">bo_type</span>
         'buftype'|'filetype': The type of buffer option
        </li>
        <li><span class="parameter">val</span>
         string: The specific value to set.
        </li>
        <li><span class="parameter">ud_opts</span>
         table: `user_default_options`
        </li>
    </ul>





</dd>
    <dt>
    <a name = "apply_alias_options"></a>
    <strong>apply_alias_options (ud_opts)</strong>
    </dt>
    <dd>
    Parse and apply alias options to the user options.


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">ud_opts</span>
         table: user_default_options
        </li>
    </ul>

    <h3>Returns:</h3>
    <ol>

        table
    </ol>




</dd>
    <dt>
    <a name = "get_setup_options"></a>
    <strong>get_setup_options (opts)</strong>
    </dt>
    <dd>
    Initializes colorizer with user-provided options.
 Merges default settings with any user-specified options, setting up `filetypes`,
 `user_default_options`, and `user_commands`.


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">opts</span>
         table|nil: Configuration options for colorizer.
        </li>
    </ul>

    <h3>Returns:</h3>
    <ol>

        table: Final settings after merging user and default options.
    </ol>




</dd>
    <dt>
    <a name = "new_bo_options"></a>
    <strong>new_bo_options (bufnr, bo_type)</strong>
    </dt>
    <dd>
    Retrieve buffer-specific options or user_default_options defined when setup() was called.


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">bufnr</span>
         number: The buffer number.
        </li>
        <li><span class="parameter">bo_type</span>
         'buftype'|'filetype': The type of buffer option
        </li>
    </ul>





</dd>
    <dt>
    <a name = "get_bo_options"></a>
    <strong>get_bo_options (bo_type, buftype, filetype)</strong>
    </dt>
    <dd>
    Retrieve options based on buffer type and file type.   Prefer filetype.


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">bo_type</span>
         'buftype'|'filetype': The type of buffer option
        </li>
        <li><span class="parameter">buftype</span>
         string: Buffer type.
        </li>
        <li><span class="parameter">filetype</span>
         string: File type.
        </li>
    </ul>

    <h3>Returns:</h3>
    <ol>

        table
    </ol>




</dd>
</dl>
    <h2 class="section-header "><a name="Tables"></a>Tables</h2>

    <dl class="function">
    <dt>
    <a name = "user_default_options"></a>
    <strong>user_default_options</strong>
    </dt>
    <dd>
    Default user options for colorizer.
This table defines individual options and alias options, allowing configuration of
colorizer's behavior for different color formats (e.g., `#RGB`, `#RRGGBB`, `#AARRGGBB`, etc.).
<p>Individual Options: Options like `names`, `RGB`, `RRGGBB`, `RRGGBBAA`, `hsl_fn`, `rgb_fn`,
`oklch_fn`, `AARRGGBB`, `tailwind`, and `sass` can be enabled or disabled independently.
<p>Alias Options: `css` and `css_fn` enable multiple options at once.
  - `css_fn = true` enables `hsl_fn`, `rgb_fn`, and `oklch_fn`.
  - `css = true` enables `names`, `RGB`, `RRGGBB`, `RRGGBBAA`, `hsl_fn`, `rgb_fn`, and `oklch_fn`.
<p>Option Priority: Individual options have higher priority than aliases.
If both `css` and `css_fn` are true, `css_fn` has more priority over `css`.


    <h3>Fields:</h3>
    <ul>
        <li><span class="parameter">names</span>
         boolean: Enables named colors (e.g., "Blue").
        </li>
        <li><span class="parameter">names_opts</span>
         table: Names options for customizing casing, digit stripping, etc
        </li>
        <li><span class="parameter">names_custom</span>
         table|function|false: Custom color name to RGB value mappings
 should return a table of color names to RGB value pairs
        </li>
        <li><span class="parameter">RGB</span>
         boolean: Enables `#RGB` hex codes.
        </li>
        <li><span class="parameter">RGBA</span>
         boolean: Enables `#RGBA` hex codes.
        </li>
        <li><span class="parameter">RRGGBB</span>
         boolean: Enables `#RRGGBB` hex codes.
        </li>
        <li><span class="parameter">RRGGBBAA</span>
         boolean: Enables `#RRGGBBAA` hex codes.
        </li>
        <li><span class="parameter">AARRGGBB</span>
         boolean: Enables `0xAARRGGBB` hex codes.
        </li>
        <li><span class="parameter">rgb_fn</span>
         boolean: Enables CSS `rgb()` and `rgba()` functions.
        </li>
        <li><span class="parameter">hsl_fn</span>
         boolean: Enables CSS `hsl()` and `hsla()` functions.
        </li>
        <li><span class="parameter">oklch_fn</span>
         boolean: Enables CSS `oklch()` function.
        </li>
        <li><span class="parameter">css</span>
         boolean: Enables all CSS features (`rgb_fn`, `hsl_fn`, `oklch_fn`, `names`, `RGB`, `RRGGBB`).
        </li>
        <li><span class="parameter">css_fn</span>
         boolean: Enables all CSS functions (`rgb_fn`, `hsl_fn`, `oklch_fn`).
        </li>
        <li><span class="parameter">tailwind</span>
         boolean|string: Enables Tailwind CSS colors (e.g., `"normal"`, `"lsp"`, `"both"`).
        </li>
        <li><span class="parameter">tailwind_opts</span>
         table: Tailwind options for updating names cache, etc
        </li>
        <li><span class="parameter">sass</span>
         table: Sass color configuration (`enable` flag and `parsers`).
        </li>
        <li><span class="parameter">mode</span>
         'background'|'foreground'|'virtualtext': Display mode
        </li>
        <li><span class="parameter">virtualtext</span>
         string: Character used for virtual text display.
        </li>
        <li><span class="parameter">virtualtext_inline</span>
         boolean|'before'|'after': Shows virtual text inline with color.
        </li>
        <li><span class="parameter">virtualtext_mode</span>
         'background'|'foreground': Mode for virtual text display.
        </li>
        <li><span class="parameter">always_update</span>
         boolean: Always update color values, even if buffer is not focused.
        </li>
        <li><span class="parameter">hooks</span> table: Table of hook functions
        <ul>
        <li><span class="parameter">disable_line_highlight</span>
         function: Returns boolean which controls if line should be parsed for highlights
        </li>
        </li></ul>
        <li><span class="parameter">xterm</span>
         boolean: Enables xterm 256-color codes (#xNN, \e[38;5;NNNm)
        </li>
    </ul>





</dd>
    <dt>
    <a name = "options"></a>
    <strong>options</strong>
    </dt>
    <dd>
    Options for colorizer that were passed in to setup function


    <h3>Fields:</h3>
    <ul>
        <li><span class="parameter">filetypes</span>

        </li>
        <li><span class="parameter">buftypes</span>

        </li>
        <li><span class="parameter">user_commands</span>

        </li>
        <li><span class="parameter">lazy_load</span>

        </li>
        <li><span class="parameter">user_default_options</span>

        </li>
        <li><span class="parameter">exclusions</span>

        </li>
        <li><span class="parameter">all</span>

        </li>
    </ul>





</dd>
    <dt>
    <a name = "ud_opts"></a>
    <strong>ud_opts</strong>
    </dt>
    <dd>
    Configuration options for the `setup` function.


    <h3>Fields:</h3>
    <ul>
        <li><span class="parameter">filetypes</span>
         (table|nil): Optional.  A list of file types where colorizer should be enabled. Use `"*"` for all file types.
        </li>
        <li><span class="parameter">user_default_options</span>
         table: Default options for color handling.
 <pre>
   - `names` (boolean): Enables named color codes like `"Blue"`.
   - `names_opts` (table): Names options for customizing casing, digit stripping, etc
     - `lowercase` (boolean): Converts color names to lowercase.
     - `camelcase` (boolean): Converts color names to camelCase.  This is the default naming scheme for colors returned from `vim.api.nvim_get_color_map`
     - `uppercase` (boolean): Converts color names to uppercase.
     - `strip_digits` (boolean): Removes digits from color names.
   - `names_custom` (table|function|false): Custom color name to RGB value mappings
   - `RGB` (boolean): Enables support for `#RGB` hex codes.
   - `RGBA` (boolean): Enables support for `#RGBA` hex codes.
   - `RRGGBB` (boolean): Enables support for `#RRGGBB` hex codes.
   - `RRGGBBAA` (boolean): Enables support for `#RRGGBBAA` hex codes.
   - `AARRGGBB` (boolean): Enables support for `0xAARRGGBB` hex codes.
   - `rgb_fn` (boolean): Enables CSS `rgb()` and `rgba()` functions.
   - `hsl_fn` (boolean): Enables CSS `hsl()` and `hsla()` functions.
   - `oklch_fn` (boolean): Enables CSS `oklch()` function.
   - `css` (boolean): Enables all CSS-related features (e.g., `names`, `RGB`, `RRGGBB`, `hsl_fn`, `rgb_fn`, `oklch_fn`).
   - `css_fn` (boolean): Enables all CSS function-related features (e.g., `rgb_fn`, `hsl_fn`, `oklch_fn`).
   - `tailwind` (boolean|string): Enables Tailwind CSS colors. Accepts `true`, `"normal"`, `"lsp"`, or `"both"`.
   - `tailwind_opts` (table): Tailwind options for updating names cache, etc
      - `update_names` (boolean): Updates Tailwind "normal" names cache from LSP results.  This provides a smoother highlighting experience when tailwind = "both" is used.  Highlighting on non-tailwind lsp buffers (like cmp) becomes more consistent.
   - `sass` (table): Configures Sass color support.
      - `enable` (boolean): Enables Sass color parsing.
      - `parsers` (table): A list of parsers to use, typically includes `"css"`.
   - `mode` (string): Determines the display mode for highlights. Options are `"background"`, `"foreground"`, and `"virtualtext"`.
   - `virtualtext` (string): Character used for virtual text display of colors (default is `"■"`).
  - `virtualtext_inline` (boolean|'before'|'after'): Shows the virtual text inline with the color.  True defaults to 'before'.
  - `virtualtext_mode` ('background'|'foreground'): Determines the display mode for virtual text.
  - `always_update` (boolean): If true, updates color values even if the buffer is not focused.</pre>
 - `hooks` (table): Table of hook functions
    - `disable_line_highlight` (function): Returns a boolean that controls if the line should be parsed for highlights. Called  with 3 parameters:
      - `line` (string): The line's contents.
      - `bufnr` (number): The buffer number.
      - `line_num` (number): The line number (0-indexed).  Add 1 to get the line number in the buffer.
        </li>
        <li><span class="parameter">buftypes</span>
         (table|nil): Optional. A list of buffer types where colorizer should be enabled. Defaults to all buffer types if not provided.
        </li>
        <li><span class="parameter">user_commands</span>
         (boolean|table): If true, enables all user commands for colorizer. If `false`, disables user commands. Alternatively, provide a table of specific commands to enable:
   - `"ColorizerAttachToBuffer"`
   - `"ColorizerDetachFromBuffer"`
   - `"ColorizerReloadAllBuffers"`
   - `"ColorizerToggle"`
        </li>
        <li><span class="parameter">lazy_load</span>
         (boolean): If true, lazily schedule buffer highlighting setup function
        </li>
    </ul>





</dd>
</dl>


</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/lunarmodules/LDoc">LDoc 1.5.0</a></i>
<i style="float:right;">Last updated - October </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>
